package com.svr.controller;

import com.svr.entity.User;
import com.svr.service.UserService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yinbo
 */
@RestController
@RequestMapping("/user")
@Api(tags = "Swagger测试相关接口",description = "Swagger测试相关接口的描述")

public class UserController {

	@Autowired
	UserService userService;

	@GetMapping("/query/{id}")
	@ApiOperation(value = "test1接口",notes = "test1接口详细描述")
	@ApiResponses(@ApiResponse(code = 202,message = "请求成功"))
	public User queryUser(@ApiParam(value = "id的说明")  @PathVariable("id") int id){
		User user = userService.queryById(id);
		System.out.println(user);
		return user;
	}

}
